
#pragma once

#define REGISTER_THIS_CATEGORY(category_enum, string_name)  \
    template <>struct Category2Name<category_enum>          \
    {                                                       \
        static const char* Name() { return #string_name; }  \
    }

namespace tools
{
    namespace variant_detail
    {
        enum eWORKSTATUS{
            ENABLED ,
            DISABLED,
            eEND_WORKSTATUS
        };

        enum eCATEGORY{
            ePRIMITIVE,
            eKEY_VARIANT,
            eLINEAR,
            eASSOCIATIVE,
            eEND_CATEGORY
        };

        template<eCATEGORY cat> struct Category2Name
        {
            static const char* Name() { return "category name error: out of range"; }
        };

        //---                  [  category  ][      string-name      ]
        REGISTER_THIS_CATEGORY(ePRIMITIVE   ,  PRIMITIVE             );
        REGISTER_THIS_CATEGORY(eKEY_VARIANT ,  KEY_VARIANT           );
        REGISTER_THIS_CATEGORY(eLINEAR      ,  LINEAR_CONTAINER      );
        REGISTER_THIS_CATEGORY(eASSOCIATIVE ,  ASSOCIATIVE_CONTAINER );
        #undef REGISTER_THIS_CATEGORY

    }//namespace value_detail
}//namespace tools


